package com.gs.weather.controller;

import com.gs.weather.dao.MicapsGeologyDao;
import com.gs.weather.entity.MicapsResolve;
import com.gs.weather.service.other.MicapsGeologyService;
import com.gs.weather.utils.Constant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Legolas
 * Date: 2017/10/10 0010
 */
@Controller
@RequestMapping(value = "micaps")
public class Micaps4Controller {
    @Autowired
    MicapsGeologyDao dao;

    //一小时
    @RequestMapping(value = "geology")
    @ResponseBody
    public List<MicapsResolve> getGeology() throws IOException {
        return dao.queryGeology(Constant.MICAPS_TYPE_1);
    }

    //三小时
    @RequestMapping(value = "geologyThree")
    @ResponseBody
    public List<MicapsResolve> getGeologyThree() throws IOException {
        return dao.queryGeology(Constant.MICAPS_TYPE_3);
    }

    //六小时
    @RequestMapping(value = "geologySix")
    @ResponseBody
    public List<MicapsResolve> getGeologySix() throws IOException {
        return dao.queryGeology(Constant.MICAPS_TYPE_6);
    }

    //十二小时
    @RequestMapping(value = "geologyTwelve")
    @ResponseBody
    public List<MicapsResolve> getGeologyTwelve() throws IOException {
        return dao.queryGeology(Constant.MICAPS_TYPE_12);
    }

    @RequestMapping(value = "geologyArea")
    @ResponseBody
    public List<String> getGeologyArea(){
        return dao.queryArea(Constant.MICAPS_TYPE_12);
    }
}
